Class symantec.itools.awt.ImageButton
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.ImageButton

Object
   |
   +----Component
           |
           +----Canvas
                   |
                   +----ButtonBase
                           |
                           +----symantec.itools.awt.ImageButton

public class ImageButton
extends ButtonBase
The ImageButton component is similar to a regular button except that it displays an image on the button's face. The image to use is specified with a URL.

Use an ImageButton to:

Version:
1.1, August 5, 1997
Author:
Symantec

Variable Index

 o IMAGE_CENTERED
A constant indicating the image is to be centered in the size of this component.
 o IMAGE_NORMAL
A constant indicating the image is to be drawn normally in the upper left corner.
 o IMAGE_SCALED_TO_FIT
A constant indicating the image is to be scaled to fit the size of this component.
 o IMAGE_TILED
A constant indicating the image is to be tiled in the size of this component.
 o disabledImage
The image displayed when the button is disabled
 o enabledImage
The normally displayed image
 o errors
Error strings.
 o imageStyle
Determines how to draw the image.
 o imageURL
The URL for the button's image
 o pressedImage
The image displayed when the button is pressed

Constructor Index

 o symantec.itools.awt.ImageButton()
Constructs a new default ImageButton.

Method Index

 o addImageStyleListener(PropertyChangeListener)
Adds a listener for the ImageStyle property changes.
 o addImageStyleListener(VetoableChangeListener)
Adds a vetoable listener for the ImageStyle property changes.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o getCenterMode()
 o getImageStyle()
Gets the current panel image style.
 o getImageURL()
Returns the URL of the image being displayed in the button.
 o getPreferredSize()
Returns the recommended dimensions to properly display this component.
 o getScaleMode()
 o isCenterMode()
 o isScaleMode()
 o isValidImageStyle(int)
Is the given image style valid for this button.
 o removeImageStyleListener(PropertyChangeListener)
Removes a listener for the ImageStyle property changes.
 o removeImageStyleListener(VetoableChangeListener)
Removes a vetoable listener for the ImageStyle property changes.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o setCenterMode(boolean)
 o setImageStyle(int)
Sets the new panel image style.
 o setImageURL(URL)
Sets the URL of the image to display in the button.
 o setScaleMode(boolean)
 o updateButtonImage()
Draws the button in the buttonImage offscreen image.

Variables

 o IMAGE_CENTERED
public static final int IMAGE_CENTERED
A constant indicating the image is to be centered in the size of this component.

 o IMAGE_NORMAL
public static final int IMAGE_NORMAL
A constant indicating the image is to be drawn normally in the upper left corner.

 o IMAGE_SCALED_TO_FIT
public static final int IMAGE_SCALED_TO_FIT
A constant indicating the image is to be scaled to fit the size of this component.

 o IMAGE_TILED
public static final int IMAGE_TILED
A constant indicating the image is to be tiled in the size of this component.

 o disabledImage
protected transient java.awt.Image disabledImage
The image displayed when the button is disabled

 o enabledImage
protected transient java.awt.Image enabledImage
The normally displayed image

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o imageStyle
protected int imageStyle
Determines how to draw the image.

 o imageURL
protected java.net.URL imageURL
The URL for the button's image

 o pressedImage
protected transient java.awt.Image pressedImage
The image displayed when the button is pressed

Constructors

 o ImageButton
public ImageButton()
Constructs a new default ImageButton. Image scaling is off and center mode on.

Methods

 o addImageStyleListener
public synchronized void addImageStyleListener(PropertyChangeListener listener)
Adds a listener for the ImageStyle property changes.

Parameters:
listener - the listener to add.
See Also:
removeImageStyleListener(java.beans.PropertyChangeListener)
 o addImageStyleListener
public synchronized void addImageStyleListener(VetoableChangeListener listener)
Adds a vetoable listener for the ImageStyle property changes.

Parameters:
listener - the listener to add.
See Also:
removeImageStyleListener(java.beans.VetoableChangeListener)
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to hook-up event listeners.

Overrides:
addNotify in class ButtonBase
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
listener - the listener to add.
Overrides:
addPropertyChangeListener in class ButtonBase
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
listener - the listener to add.
Overrides:
addVetoableChangeListener in class ButtonBase
See Also:
removeVetoableChangeListener
 o getCenterMode
public boolean getCenterMode()
Note: getCenterMode() is deprecated.

See Also:
isCenterMode
 o getImageStyle
public int getImageStyle()
Gets the current panel image style.

Returns:
the current panel image style, one of IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, or IMAGE_NORMAL.
See Also:
setImageStyle, IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT
 o getImageURL
public java.net.URL getImageURL()
Returns the URL of the image being displayed in the button.

See Also:
setImageURL
 o getPreferredSize
public java.awt.Dimension getPreferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Overrides:
getPreferredSize in class ButtonBase
 o getScaleMode
public boolean getScaleMode()
Note: getScaleMode() is deprecated.

See Also:
isScaleMode
 o isCenterMode
public boolean isCenterMode()
Note: isCenterMode() is deprecated.

See Also:
getImageStyle
 o isScaleMode
public boolean isScaleMode()
Note: isScaleMode() is deprecated.

See Also:
getImageStyle
 o isValidImageStyle
public boolean isValidImageStyle(int i)
Is the given image style valid for this button.

Parameters:
i - the given image style
Returns:
true if the given image style is acceptable, false if not.
 o removeImageStyleListener
public synchronized void removeImageStyleListener(PropertyChangeListener listener)
Removes a listener for the ImageStyle property changes.

Parameters:
listener - the listener to remove.
See Also:
addImageStyleListener(java.beans.PropertyChangeListener)
 o removeImageStyleListener
public synchronized void removeImageStyleListener(VetoableChangeListener listener)
Removes a vetoable listener for the ImageStyle property changes.

Parameters:
listener - the listener to remove.
See Also:
addImageStyleListener(java.beans.VetoableChangeListener)
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to unhook event listeners.

Overrides:
removeNotify in class ButtonBase
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
listener - the listener to remove.
Overrides:
removePropertyChangeListener in class ButtonBase
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
listener - the listener to remove.
Overrides:
removeVetoableChangeListener in class ButtonBase
See Also:
addVetoableChangeListener
 o setCenterMode
public void setCenterMode(boolean flag) throws PropertyVetoException
Note: setCenterMode() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setImageStyle
 o setImageStyle
public void setImageStyle(int newStyle) throws PropertyVetoException
Sets the new panel image style.

Parameters:
newStyle - the new panel image style, one of IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, or IMAGE_NORMAL.
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getImageStyle, IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT, IMAGE_NORMAL
 o setImageURL
public void setImageURL(URL u) throws PropertyVetoException
Sets the URL of the image to display in the button.

Parameters:
u - the URL of the image to display
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getImageURL
 o setScaleMode
public void setScaleMode(boolean flag) throws PropertyVetoException
Note: setScaleMode() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setImageStyle
 o updateButtonImage
protected void updateButtonImage()
Draws the button in the buttonImage offscreen image.

Overrides:
updateButtonImage in class ButtonBase
See Also:
updateButtonImage

All Packages  Class Hierarchy  This Package  Previous  Next  Index